//
//  BIDDatabaseManager.h
//  EducationAssistant
//
//  Created by mal on 15/7/31.
//  Copyright (c) 2015年 cnsoft. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface BIDDatabaseManager : NSObject

+ (id)getInstance;

//打开或新建数据库
- (BOOL)openDB;

//执行sql语句
- (BOOL)execSQL:(NSString*)strSQL;

//创建数据表
- (BOOL)createTable:(NSString*)tableName;

//删除数据表
- (BOOL)deleteTable:(NSString*)tableName;

//删除表中所有记录
- (BOOL)deleteAllFromTable:(NSString*)tableName;

//向表中插入数据
- (BOOL)insertRecordToTable:(NSString*)tableName content:(NSDictionary*)contentDic;

//删除表中的某条记录
- (BOOL)deleteRecordFromTable:(NSString*)tableName condition:(NSDictionary*)conditionDic;

//查询数据
- (NSArray*)queryFromTable:(NSString*)tableName fields:(NSArray*)fieldArr condition:(NSDictionary*)conditionDic index:(NSInteger)index;

//更新数据
- (BOOL)updateTable:(NSString*)tableName content:(NSDictionary*)contentDic condition:(NSDictionary*)conditionDic;

//判断表是否存在
- (BOOL)isTableExist:(NSString*)tableName;

//关闭数据库
- (BOOL)closeDB;

@end
